<html>
<head><meta charset="utf-8"><title>async move resolutions · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html">async move resolutions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206144279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206144279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206144279">(Aug 06 2020 at 13:59)</a>:</h4>
<p>I just filed <a href="https://github.com/rust-analyzer/rust-analyzer/issues/5676">https://github.com/rust-analyzer/rust-analyzer/issues/5676</a> and I'm curious where I could start attempting to fix that issue. Is this internal to RA or does it come from one of the libraries like chalk?</p>



<a name="206144758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206144758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206144758">(Aug 06 2020 at 14:02)</a>:</h4>
<p>There are some mentoring instructions in <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4018#issue-602093106">https://github.com/rust-analyzer/rust-analyzer/issues/4018#issue-602093106</a>. But in the meanwhile it seems we've got an <code>Expr::Unsafe</code>, so maybe it should be <code>Expr::Async</code> for symmetry</p>



<a name="206144761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206144761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206144761">(Aug 06 2020 at 14:02)</a>:</h4>
<p>it's a bit of an open design question how to best model async blocks in the type system in rust-analyzer right now (as you can read in the issue I linked); we could use opaque types, but it would be a bit of a misuse; more proper would be generators, but they don't exist yet in Chalk's type library</p>



<a name="206144773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206144773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206144773">(Aug 06 2020 at 14:02)</a>:</h4>
<p>Is <code>unsafe async {}</code> a thing?</p>



<a name="206145402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206145402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206145402">(Aug 06 2020 at 14:07)</a>:</h4>
<p>Oh ok, should I close the one I filed as a duplicate then?</p>



<a name="206145481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206145481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206145481">(Aug 06 2020 at 14:07)</a>:</h4>
<p>I already did</p>



<a name="206145533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206145533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206145533">(Aug 06 2020 at 14:08)</a>:</h4>
<p>Thanks!</p>



<a name="206145727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206145727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206145727">(Aug 06 2020 at 14:09)</a>:</h4>
<p>I might try to start tackling this after work today, or is there someone already working on it?</p>



<a name="206145866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206145866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206145866">(Aug 06 2020 at 14:10)</a>:</h4>
<p>Could this be implemented with opaque types to improve resolution, and we file an issue to move to generators once it's supported by chalk?</p>



<a name="206146427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206146427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206146427">(Aug 06 2020 at 14:14)</a>:</h4>
<p>it could, but I'd rather improve Chalk than work around it</p>



<a name="206147723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206147723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206147723">(Aug 06 2020 at 14:24)</a>:</h4>
<p>I might be getting in over my head here, but where is the discussion room for chalk? I'll see if there any way I can help</p>



<a name="206148002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206148002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206148002">(Aug 06 2020 at 14:26)</a>:</h4>
<p><a class="stream" data-stream-id="144729" href="/#narrow/stream/144729-wg-traits">#wg-traits</a> . I think the chalk issue is <a href="https://github.com/rust-lang/chalk/issues/504">rust-lang/chalk#504</a></p>



<a name="206148102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206148102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206148102">(Aug 06 2020 at 14:26)</a>:</h4>
<p>it's probably actually not a complicated thing to add, since we don't need any built-in behavior for it, just the type itself, I think</p>



<a name="206149759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206149759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206149759">(Aug 06 2020 at 14:39)</a>:</h4>
<p>Ok, I'll ask there after work. Thanks!</p>



<a name="206213264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206213264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206213264">(Aug 07 2020 at 00:29)</a>:</h4>
<p>Looks like there's still someone working on it. I'll move on to something else for now.</p>



<a name="206226244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206226244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206226244">(Aug 07 2020 at 05:54)</a>:</h4>
<p>I think you can still work on the parser and IR support for async blocks</p>



<a name="206229741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206229741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206229741">(Aug 07 2020 at 07:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116114">Paul Faria</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/async.20move.20resolutions/near/206213264">said</a>:</p>
<blockquote>
<p>Looks like there's still someone working on it. I'll move on to something else for now.</p>
</blockquote>
<p>If you mean <a href="https://github.com/rust-lang-nursery/chalk/issues/504">chalk#504</a>, that was assigned 2 months ago and I don't think there has been progress lately, so you could drop a comment asking if it's still being worked on</p>



<a name="206251563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206251563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206251563">(Aug 07 2020 at 12:39)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> I had reached out to the person it was assigned to, and he said he still has some work left and was planning to put up a draft PR with his work so far.</p>



<a name="206251694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206251694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206251694">(Aug 07 2020 at 12:41)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> I thought async was already tracked in the parser, similarly to how unsafe blocks are handled. What do you mean regarding IR support?</p>



<a name="206251793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206251793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206251793">(Aug 07 2020 at 12:42)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir_def/src/expr.rs#L52-L55">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir_def/src/expr.rs#L52-L55</a></p>



<a name="206251815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206251815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206251815">(Aug 07 2020 at 12:42)</a>:</h4>
<p>I was saying there's an <code>Expr::Unsafe</code> variant for <code>unsafe</code> blocks, but no variant for <code>async</code> ones and I wasn't sure if it should be a variant or an attribute of the block</p>



<a name="206251873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206251873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206251873">(Aug 07 2020 at 12:43)</a>:</h4>
<p>Hence my <code>unsafe async {}</code> question</p>



<a name="206252540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/async%20move%20resolutions/near/206252540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/async.20move.20resolutions.html#206252540">(Aug 07 2020 at 12:50)</a>:</h4>
<p>But yes, the parser accepts it IIRC</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>